package com.example.backend.dto;

import com.example.backend.domain.enums.TicketPriority;
import com.example.backend.domain.enums.TicketSource;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.Instant;

/**
 * 创建工单请求DTO
 */
@Data
public class CreateTicketRequest {
    @NotBlank(message = "工单标题不能为空")
    @Size(max = 200, message = "工单标题长度不能超过200个字符")
    private String title;

    @NotBlank(message = "工单描述不能为空")
    @Size(max = 2000, message = "工单描述长度不能超过2000个字符")
    private String description;

    @Size(max = 5000, message = "详细描述长度不能超过5000个字符")
    private String descriptionDetail;

    private Long categoryId;
    
    @NotNull(message = "优先级不能为空")
    private TicketPriority priority;
    
    @NotNull(message = "客户ID不能为空")
    private Long customerId;
    
    private Long assignedToId;
    
    private TicketSource source = TicketSource.WEB;
    
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private Instant dueDate;
    
    private BigDecimal estimatedHours;
    
    private String internalNotes;
    
    private Boolean isPublic = true;
    
    private Boolean isEscalated = false;
    
    private String escalationReason;
}
